<?php
date_default_timezone_set('Asia/Chongqing' );
//define( "WB_CALLBACK" , '/setting/bindResultAccount');
// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'【名人吧】mr8.me',
	'sourceLanguage'=>'zh_cn',
	'defaultController'=>'site/index',
	// preloading 'log' component
	'preload'=>array('log','session'),

	// autoloading model and component classes
	'import'=>array(
		'application.helpers.*',
		'application.models.*',
		'application.models.form.*',
		'application.components.*',
 		'ext.YiiMongoDbSuite.*',
 		'ext.YiiMongoDbSuite.extra.*',
 		'ext.WeiboApi.*',
 		'ext.WeiboApi.P100.*',
// 		'ext.EYiiMongo.*',
		'ext.mail.Message',
	),

	// application components
	'components'=>array(
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
		),
		'mongodb' => array(
	        'class'             => 'EMongoDB',
	        'connectionString'  => 'mongodb://localhost',
	        'dbName'            => 'mr8',
	        'fsyncFlag'         => true,
	        'safeFlag'          => true,
	        'useCursor'         => false,
	    ),
	    'mail'=>array(
  			'class' => 'ext.mail.Mail',	//set to the path of the extension
  			'transportType' => 'php',
 			'viewPath' => 'application.views.mail',
 			'debug' => false
 		),
	    'image'=>array(
            'class'=>'application.components.MrImageComponent',
            // GD or ImageMagick
            'driver'=>'GD',
            // ImageMagick setup path
//            'params'=>array('directory'=>'D:/Program Files/ImageMagick-6.4.8-Q16'),
        ),
        
        'wbService'=>array(
            'class'=>'application.components.WeiboAuthServiceComponent',

        ), 
		// uncomment the following to enable URLs in path-format
		 
//		'urlManager'=>array(
//			'showScriptName'=>false,
//			'caseSensitive'=>true,
//			'urlFormat'=>'path',
//			'rules'=> require(dirname(__FILE__).'/route.php'),
//		),
	 
//		'db'=>array(
//			'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
//		),
		// uncomment the following to use a MySQL database
		/*
		'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=testdrive',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => '',
			'charset' => 'utf8',
		),
		*/
		'errorHandler'=>array(
			// use 'site/error' action to display errors
            'errorAction'=>'site/error',
        ),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>' error, warning',
				),
				// uncomment the following to show log messages on web pages
				 
//				array(
//					'class'=>'CWebLogRoute',
//				),
				 
			),
		),
	),

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>array(
		// this is used in contact page
		'adminEmail'=>'webmaster@example.com',
		'keys'=>array(),
	),
);